﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Configuration;
using DropBoxClient.Entities;

namespace DropBoxClient.Tests
{
    [TestClass]
    public class GetCopyRefTest
    {
        private string accessToken;
        private CopyReference copyRef;

        [TestInitialize]
        public void Init()
        {
            accessToken = ConfigurationManager.AppSettings["AccessToken"];
            var client = new OAuth2Client(accessToken);
            copyRef = client.GetCopyRef(StringConstants.SandboxRoot, "Test/Notes.txt");
        }

        [TestMethod]
        public void GetCopyRef_ResultIsNotNull()
        {
            Assert.IsNotNull(copyRef);
        }

        [TestMethod]
        public void GetCopyRef_RefIsValid()
        {
            Assert.IsTrue(copyRef.Reference.Length > 0);
        }
    }
}
